﻿<Viewbox x:Class="TomsToolbox.Wpf.Controls.MapTile"
         xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
         xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
         xmlns:controls="clr-namespace:TomsToolbox.Wpf.Controls"
         Stretch="Uniform" x:Name="ViewPort">
  <Grid x:Name="World" Width="{x:Static controls:MapTile.TileSize}" Height="{x:Static controls:MapTile.TileSize}">
    <Image Stretch="None" Source="{Binding Image.Source, ElementName=ViewPort, IsAsync=True}" />
    <UniformGrid x:Name="SubLevel" Rows="2" Columns="2" />
    <!-- Debugging only:
    <Border Background="Transparent" BorderBrush="Gray" BorderThickness="1">
      <TextBlock Text="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType=Viewbox}}" VerticalAlignment="Center" HorizontalAlignment="Center"/>
    </Border>-->
  </Grid>
</Viewbox>